/* 
 * File:   ConfigurationFile.h
 * Copyright (C) 2008, 2009
 *		Sergio Padrino Recio (PadrinatoR)
 *		DOC
 *		Joseba Saenz de Navarrete Royo
 *		Nacho
 *
 * Created on 8 de septiembre de 2008, 20:33
 *
 * This file is part of BombProject.
 * 
 * BombProject is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
   
 * BombProject is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.

 * You should have received a copy of the GNU General Public License
 * along with BombProject.  If not, see <http://www.gnu.org/licenses/>.
 */

#ifndef _CONFIGURATIONFILE_H
#define	_CONFIGURATIONFILE_H

#include <map>
#include <string>
#include <vector>

#include "InputDevice.h"

using namespace std;

/**
 * This class is used to parse configuration files and get saved values from it.<br>
 * More information: <a>http://code.google.com/p/bomb-project/wiki/ConfigurationFormat</a>
 */
class ConfigurationFile {
protected:
	map<string, string> variablesList;

public:
	ConfigurationFile();
	~ConfigurationFile();
	
	bool loadFile(string filename);
	
	int getInteger(string variable, int default_value = 0);
	string getString(string variable, string default_value = "");
	vector<int> getIntegerList(string variable, char separator = ',');
	bool getButtonInfo(string variable, DeviceButtonInfo& info);

protected:
	void parse(string data);
};

#endif	/* _CONFIGURATIONFILE_H */
